//
// Created by xili on 2024/8/17 11:14.
// GO BIG OR GO HOME.
//
#include "leetcode.h"

class Solution {
public:
    int minimumSum(int num) {
        vector<int> digits;
        while (num) {
            digits.push_back(num % 10);
            num /= 10;
        }
        sort(digits.begin(), digits.end());
        return 10 * (digits[0] + digits[1]) + digits[2] + digits[3];
    }
};